<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let a= 2+2
        let b= 2-2
        let c= 2*2
        let d= 2/2
        let f= 7/4
        let e= 2**2
        let g= 9>2
        let h= 9<2
        let res1= 0>2&&2>0
        let res2= 0>2||2>0
        let res3= !(0>2)
        let res4= 9==9
        let res5= 9===9
        let res6= 9=="9"
        let res7= 9==="9"
        let res8= 9!="9"
        let res9= 9!=="9"
        console.log("2+2=",a)
        console.log("2-2=",b)
        console.log("2*2=",c)
        console.log("2/2=",d)
        console.log("2**2=",e)
        console.log("7/4=",f)
        console.log("9>2=",g)
        console.log("9<2=",h)
        console.log(" 0>2&&2>0=",res1)
        console.log(" 0>2||2>0=",res2)
        console.log("  !(0>2)=",res3)
        console.log(" 9==9=",res4)
        console.log(" 9===9=",res5)
        console.log(" 9==字符串9=",res6)//隐式转换
        console.log(" 9===字符串9=",res7)
        console.log(" 9!=字符串9=",res8)
        console.log(" 9!==字符串9=",res9)
        let res12= 8&&4//返回4因为俩都是真值
        console.log(res12)
        let res13=0&&4//返回0因为0是假值
        //自增运算符
        let res=1
        console.log(++res)
        console.log(res++)

        let res10="dasong"||"wangwu"
        console.log("res10",res10)

        //程序结构(if else,循环)
        let res11=""
        if(res11 ==="")
    {res11="wangwu"}
    console.log("res11",res11)
    //1条件结构（if-else、循环）
    let res14 = ""
    if (res14==="") {
    res14 = "change";
    } else if (res14 === "song") {
    res14 = "change";
}
    console.log("res14", res14);

    //2.循环
    let arr = ["赛罗", "迪迦", "梦比优斯","贝利亚","xiansong大王","酱油"];
    for (let i = 1; i < arr.length; i++) {
    console.log(arr[i]);
}
    let arr1 = new Array("赛罗", "迪迦", "梦比优斯","贝利亚","xiansong大王","酱油");
    let n = 0;
    while (n < arr1.length) {
    console.log(arr1[n])
    console.log("跑步之前我的体力值",n)
    n--;
    console.log("跑步之后我的体力值",n)
}
    //3.数组
    //（1）函数的参数也是函数
    //加法
    function add(x,y){
    return x+y
}
    let result =add(5,3)
    console.log(result)
    //乘法
    function mul(x,y){
    return x*y
}
    let result1 =mul(5,3)
    console.log(result1)
    //做计算
    function compute(x,y,z){
    z(x,y) 
}
    let aa = compute(5,3,add)

    let m = compute(8,5,(x,y)=>{
        return x+y
    })
    </script>
</body>
</html>